import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import treeTable from 'vue-table-with-tree-grid'
import vueQuillEditor from "vue-quill-editor"


import './plugins/element.js'
// 导入字体图标
import './assets/fonts/iconfont.css'
// 导入全局
import './assets/css/global.css'

import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme

Vue.config.productionTip = false

Vue.prototype.$http = axios

Vue.use(treeTable) 
Vue.use(vueQuillEditor)

Vue.filter('dateFormat',function(date){
  const dates=new Date(date)
  const y=dates.getFullYear()
  const m=(dates.getMonth()+1+'').padStart(2,'0')
  const d=(dates.getDate()+"").padStart(2,'0')
  const hh=(dates.getHours()+'').padStart(2,'0')
  const mm=(dates.getMonth()+'').padStart(2,'0')
  const ss=(dates.getSeconds()+'').padStart(2,'0')
  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})
// 添加请求拦截器
axios.interceptors.request.use(config => {
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})
// http://127.0.0.1:8888/api/private/v1/

axios.defaults.baseURL = 'https://lianghj.top:8888/api/private/v1/'

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
